package org.compiere.process;
import java.io.File;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Properties;
import java.util.TimeZone;
import java.util.logging.Level;

import jxl.Workbook;
import jxl.format.Alignment;
import jxl.format.Border;
import jxl.format.BorderLineStyle;
import jxl.format.CellFormat;
import jxl.format.Colour;
import jxl.format.VerticalAlignment;
import jxl.write.Formula;
import jxl.write.Label;
import jxl.write.Number;
import jxl.write.NumberFormats;
import jxl.write.WritableCell;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;

import org.adempiere.exceptions.AdempiereException;
import org.compiere.apps.ADialog;
import org.compiere.model.MAttachmentEntry;
import org.compiere.process.SvrProcess;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.eevolution.model.X_HR_Department;

import extend.org.compiere.hrm.ExcelCell;
import extend.org.compiere.utils.Util;


public class ReportRecordOfService extends SvrProcess {
	
	/** Current context		*/
	private Properties m_ctx;
	/**	 */
	private ProcessInfo pi;
	/** */
	private int HR_Department_ID = 0;
	/** */
	private int HR_Block_ID = 0;
	/** */
	private String path = "";
	/** */
	X_HR_Department department = null;
	/** */
	X_HR_Department block = null;
	/** Date defines */
	SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM_yyyy");	
	Timestamp dateFrom = null;

	@Override
	protected void prepare() {

		log.info(" Report Record Of Service ");
		m_ctx = Env.getCtx();
		pi = getProcessInfo();
	
		ProcessInfoParameter[] para = getParameter();
		for (int i = 0; i < para.length; i++)	{
			String name = para[i].getParameterName();
			if (name == null); 
				//
			else if (name.compareTo("HR_Block_ID") == 0 && para[i].getParameter() != null)
				HR_Block_ID = new BigDecimal(Integer.parseInt(para[i].getParameter().toString())).intValue();
			else if (name.compareTo("HR_Department_ID") == 0 && para[i].getParameter() != null)
				HR_Department_ID = new BigDecimal(Integer.parseInt(para[i].getParameter().toString())).intValue();
			else if (name.toLowerCase().endsWith("directory"))
				path = (String)para[i].getParameter();
			else
			{
				log.log(Level.INFO, "Unknown Parameter: " + name);
			}
		}
		
		if(path.isEmpty())
			path = Util.localFilePath;
		else
			path = path + System.getProperty("file.separator");
		
		department = new X_HR_Department(getCtx(), HR_Department_ID, null);
		block = new X_HR_Department(getCtx(), HR_Block_ID, null);	

	}

	@Override
	protected String doIt() throws Exception {

		// Types of cells for
		Label label;
		Number number;
		Formula formula;
		Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
		dateFrom = new Timestamp (calendar.getTime().getTime());
		// There are checks for a specified pattern
		String templateName = "Отчет_по_стажу_по_состоянию_на_" + dateFormat.format(dateFrom) ;
		
		//
		MAttachmentEntry entry = Util.getAttachment(pi, m_ctx, templateName);
		if(entry == null)
			throw new AdempiereException(Msg.translate(m_ctx, "NotFoundTemplate") + " " + templateName);
		
		// We define a path to generate
		String fileExtension = entry.getName().substring(entry.getName().lastIndexOf("."),entry.getName().length());
		StringBuffer fullPath = new StringBuffer(path); 
		//fullPath.append("Record Of Service").append(fileExtension);
		fullPath.append("\\").append(templateName).append(fileExtension);
		String sampleTemp = Util.localFilePath + "AdempiereTemp";
		
		// 
        File templateCopy = new File(fullPath.toString());
        File sampleCopy = new File(sampleTemp);
        File temporaryFile = entry.getFile(Util.localFilePath + templateName);
        File temporarySample = entry.getFile(Util.localFilePath + templateName);	
		Workbook tableBook = null;
		WritableWorkbook copy = null;
		WritableSheet sheet = null;
		// for sample
		Workbook sample = null;
		WritableWorkbook samCopy = null;
		WritableSheet sheet1 = null;
		try {
			tableBook = Workbook.getWorkbook(temporaryFile);
			copy = Workbook.createWorkbook(templateCopy, tableBook);
			sheet = copy.getSheet(0);
			sheet1 = copy.getSheet(1);
			// for sample
			sample = Workbook.getWorkbook(temporarySample);
			samCopy = Workbook.createWorkbook(sampleCopy, sample);
			sheet = copy.getSheet(0);
			sheet1 = copy.getSheet(1);
			samCopy.write();
		} catch (Exception e) {
			ADialog.error(999, null, "Error tableBook. " + e.getMessage());
		    return "Error tableBook.";
		}

		ExcelCell cellStart =  Util.getCellStart(tableBook,">>");
		
		// Standart style cell
		WritableCellFormat borderStyle = new WritableCellFormat();
		borderStyle.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
		borderStyle.setAlignment(Alignment.CENTRE);
		borderStyle.setVerticalAlignment(VerticalAlignment.CENTRE);
		borderStyle.setWrap(true);
		// Department style cell
		WritableFont fontDepartment = new WritableFont (WritableFont.TIMES, 12, WritableFont.BOLD);
		WritableCellFormat cellDepartment = new WritableCellFormat(fontDepartment);
		cellDepartment.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
		cellDepartment.setAlignment(Alignment.CENTRE);
		cellDepartment.setVerticalAlignment(VerticalAlignment.CENTRE);
		cellDepartment.setBackground(Colour.TAN);
		cellDepartment.setWrap(true);
		// Job style cell
		WritableCellFormat jobStyle = new WritableCellFormat();
		jobStyle.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
		jobStyle.setAlignment(Alignment.LEFT);
		jobStyle.setVerticalAlignment(VerticalAlignment.CENTRE);
		jobStyle.setWrap(true);
		// Title style cell
		WritableFont fontTitle = new WritableFont (WritableFont.TIMES, 14, WritableFont.NO_BOLD);
		WritableCellFormat titleStyle = new WritableCellFormat(fontTitle);
		titleStyle.setAlignment(Alignment.CENTRE);
		titleStyle.setVerticalAlignment(VerticalAlignment.CENTRE);
		// Percent format
		WritableFont font = new WritableFont (WritableFont.TIMES, 12, WritableFont.BOLD);
		WritableCellFormat percentf = new WritableCellFormat(font, NumberFormats.PERCENT_INTEGER);
		percentf.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
		percentf.setAlignment(Alignment.CENTRE);
		percentf.setVerticalAlignment(VerticalAlignment.CENTRE);
		// Total style cell
	    WritableFont fontTotal = new WritableFont (WritableFont.TIMES, 14, WritableFont.BOLD);
	    WritableCellFormat totalStyle = new WritableCellFormat(fontTotal);
	    totalStyle.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
	    totalStyle.setAlignment(Alignment.CENTRE);
	    totalStyle.setVerticalAlignment(VerticalAlignment.CENTRE);
	    totalStyle.setBackground(Colour.GRAY_25);
		
	    // header report
	    WritableCell readCell = sheet.getWritableCell(1, 1);
		CellFormat readFormat = readCell.getCellFormat();
		label = new Label(1, 1, sheet.getCell(1, 1).getContents() + Util.getOrgInfo().getDescription(), readFormat);
		sheet.addCell(label);
	    
		// set title
		if(HR_Department_ID != 0){
			label = new Label(1, 2, department.getName(), titleStyle);
			sheet.addCell(label);
		}
		else if(HR_Block_ID != 0){
			label = new Label(1, 2, "Блока " + block.getName(), titleStyle);
			sheet.addCell(label);
		}
		
		RecordOfService[] lines = getValues();
		int col = cellStart.getC(); // offset by the number of first columns
	    int row = cellStart.getR();
	    int rowC = cellStart.getR();
	    int n = 0;
	    int num = 1;
	    int dId = 0; // Departmnet ID
	    int dep = 0;
	    for(int j = row; j < (row+lines.length); j++){
	    	 if(dId != lines[n].getDepartment_id()){
		    	   dId = lines[n].getDepartment_id();
		    	   sheet.insertRow(j+dep);
		    	   sheet.mergeCells(1, j+dep, 2, j+dep);
		    	   sheet.setRowView(j+dep, 600);
		    	   label = new Label(col, j+dep, lines[n].getDepartment(), cellDepartment); 
			       sheet.addCell(label);
			    	// Base Dep < 1
			    	number = new Number(col+2, j+dep, lines[n].getDepBase1(), cellDepartment); 
			    	sheet.addCell(number);
			    	// Company Dep < 1
			    	number = new Number(col+3, j+dep, lines[n].getDepComp1(), cellDepartment); 
			    	sheet.addCell(number);
			    	// Base Dep >= 1 and <= 3
			    	number = new Number(col+4, j+dep, lines[n].getDepBase1_3(), cellDepartment); 
			    	sheet.addCell(number);
			    	// Company Dep >= 1 and <= 3
			    	number = new Number(col+5, j+dep, lines[n].getDepComp1_3(), cellDepartment); 
			    	sheet.addCell(number);
			    	// Base Dep >= 4 and <= 6
			    	number = new Number(col+6, j+dep, lines[n].getDepBase4_6(), cellDepartment); 
			    	sheet.addCell(number);
			    	// Company Dep >= 4 and <= 6
			    	number = new Number(col+7, j+dep, lines[n].getDepComp4_6(), cellDepartment); 
			    	sheet.addCell(number);
			    	// Base Dep >= 7 and <= 10
			    	number = new Number(col+8, j+dep, lines[n].getDepBase7_10(), cellDepartment); 
			    	sheet.addCell(number);
			    	// Company Dep >= 7 and <= 10
			    	number = new Number(col+9, j+dep, lines[n].getDepComp7_10(), cellDepartment); 
			    	sheet.addCell(number);
			    	// Base Dep >= 11 and <= 15
			    	number = new Number(col+10, j+dep, lines[n].getDepBase11_15(), cellDepartment); 
			    	sheet.addCell(number);
			    	// Company Dep >= 11 and <= 15
			    	number = new Number(col+11, j+dep, lines[n].getDepComp11_15(), cellDepartment); 
			    	sheet.addCell(number);
			    	// Base Dep > 15
			    	number = new Number(col+12, j+dep, lines[n].getDepBase15(), cellDepartment); 
			    	sheet.addCell(number);
			    	// Company Dep > 15
			    	number = new Number(col+13, j+dep, lines[n].getDepComp15(), cellDepartment); 
			    	sheet.addCell(number);

		    	   dep++;
	    	   }   
	    	 
	    	 sheet.setRowView(j+dep, 500);
	    	 // #
	    	 number = new Number(cellStart.getC(), j+dep, num, borderStyle); 
	    	 sheet.addCell(number);
	    	 //	job name
	    	 label = new Label(col+1, j+dep, lines[n].getJob(),jobStyle);
	    	 sheet.addCell(label);
	    	 // Base Job < 1
	    	 number = new Number(col+2, j+dep, lines[n].getJobBase1(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Company Job < 1
	    	 number = new Number(col+3, j+dep, lines[n].getJobComp1(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Base Job >= 1 and <= 3
	    	 number = new Number(col+4, j+dep, lines[n].getJobBase1_3(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Company Job >= 1 and <= 3
	    	 number = new Number(col+5, j+dep, lines[n].getJobComp1_3(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Base Job >= 4 and <= 6
	    	 number = new Number(col+6, j+dep, lines[n].getJobBase4_6(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Company Job >= 4 and <= 6
	    	 number = new Number(col+7, j+dep, lines[n].getJobComp4_6(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Base Job >= 7 and <= 10
	    	 number = new Number(col+8, j+dep, lines[n].getJobBase7_10(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Company Job >= 7 and <= 10
	    	 number = new Number(col+9, j+dep, lines[n].getJobComp7_10(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Base Job >= 11 and <= 15
	    	 number = new Number(col+10, j+dep, lines[n].getJobBase11_15(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Company Job >= 11 and <= 15
	    	 number = new Number(col+11, j+dep, lines[n].getJobComp11_15(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Base Job > 15
	    	 number = new Number(col+12, j+dep, lines[n].getJobBase15(), borderStyle); 
	    	 sheet.addCell(number);
	    	 // Company Job > 15
	    	 number = new Number(col+13, j+dep, lines[n].getJobComp15(), borderStyle); 
	    	 sheet.addCell(number);
	    	 
	    	 rowC = j+dep;
	    	 n++;
	    	 num++;
	    }
	    
	    //---> Total
	    rowC++;
	    if(HR_Department_ID == 0){
	    	
	    	sheet.mergeCells(col, rowC, col+1, rowC);
	    	sheet.setRowView(rowC, 700);
	    	// Total
	    	label = new Label(col, rowC, "ИТОГО", totalStyle); 
		    sheet.addCell(label);
			//	Base Job < 1
		   	number = new Number(col+2, rowC, lines[0].getSumJobBase1(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Company Job < 1                
		   	number = new Number(col+3, rowC, lines[0].getSumJobComp1(), totalStyle); 
		   	sheet.addCell(number);
		   	//	Base Job >= 1 and <= 3              
		   	number = new Number(col+4, rowC, lines[0].getSumJobBase1_3(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Company Job >= 1 and <= 3                
		   	number = new Number(col+5, rowC, lines[0].getSumJobComp1_3(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Base Job >= 4 and <= 6               
		   	number = new Number(col+6, rowC, lines[0].getSumJobBase4_6(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Company Job >= 4 and <= 6                
		   	number = new Number(col+7, rowC, lines[0].getSumJobComp4_6(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Base Job >= 7 and <= 10               
		   	number = new Number(col+8, rowC, lines[0].getSumJobBase7_10(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Company Job >= 7 and <= 10                
		   	number = new Number(col+9, rowC, lines[0].getSumJobComp7_10(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Base Job >= 11 and <= 15               
		   	number = new Number(col+10, rowC, lines[0].getSumJobBase11_15(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Company Job >= 11 and <= 15                
		   	number = new Number(col+11, rowC, lines[0].getSumJobComp11_15(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Base Job > 15               
		   	number = new Number(col+12, rowC, lines[0].getSumJobBase15(), totalStyle); 
		   	sheet.addCell(number);                  
		   	//	Company Job > 15             
		   	number = new Number(col+13, rowC, lines[0].getSumJobComp15(), totalStyle); 
		   	sheet.addCell(number);   
		   	
		   	// Diagram Base Job
		   	formula = new Formula(col+2, 2, sheet.getName()+"!D"+(rowC+1));
			sheet1.addCell(formula);
			formula = new Formula(col+3, 2, sheet.getName()+"!F"+(rowC+1));
			sheet1.addCell(formula);
			formula = new Formula(col+4, 2, sheet.getName()+"!H"+(rowC+1));
			sheet1.addCell(formula);
			formula = new Formula(col+5, 2, sheet.getName()+"!J"+(rowC+1));
			sheet1.addCell(formula);
			formula = new Formula(col+6, 2, sheet.getName()+"!L"+(rowC+1));
			sheet1.addCell(formula);
			formula = new Formula(col+7, 2, sheet.getName()+"!N"+(rowC+1));
			sheet1.addCell(formula);
			
			// Diagram Company Job
		   	formula = new Formula(col+9, 2, sheet.getName()+"!E"+(rowC+1));
			sheet1.addCell(formula);
			formula = new Formula(col+10, 2, sheet.getName()+"!G"+(rowC+1));
			sheet1.addCell(formula);
			formula = new Formula(col+11, 2, sheet.getName()+"!I"+(rowC+1));
			sheet1.addCell(formula);
			formula = new Formula(col+12, 2, sheet.getName()+"!K"+(rowC+1));
			sheet1.addCell(formula);
			formula = new Formula(col+13, 2, sheet.getName()+"!M"+(rowC+1));
			sheet1.addCell(formula);
			formula = new Formula(col+14, 2, sheet.getName()+"!O"+(rowC+1));
			sheet1.addCell(formula);

	    }
	   	// <---
	    
	    if(HR_Block_ID == 0 && HR_Department_ID == 0)
	    	sheet.removeRow(2);
	    
	    copy.write();
	    copy.close();
	    tableBook.close();
	    temporaryFile.delete();
	       
		// Open the file with the application associated
		String fileName = fullPath.toString();
		Util.launchFile(new File(fileName));
				
		return Msg.translate(m_ctx, "Success");
	}
	
	private RecordOfService[] getValues(){
		
		RecordOfService values = new RecordOfService();
		List<RecordOfService> list = new ArrayList<RecordOfService>();
		PreparedStatement pstmt = null;
		ResultSet rs = null;		
		
		StringBuffer sql = new StringBuffer("SELECT t.*, \n");
		sql.append("sum(t.job_base_1) over () as sumjob_base_1, sum(t.job_comp_1) over () as sumjob_comp_1, \n"+
					"sum(t.job_base_1_3) over () as sumjob_base_1_3, sum(t.job_comp_1_3) over () as sumjob_comp_1_3, \n"+
					"sum(t.job_base_4_6) over () as sumjob_base_4_6, sum(t.job_comp_4_6) over () as sumjob_comp_4_6, \n"+
					"sum(t.job_base_7_10) over () as sumjob_base_7_10, sum(t.job_comp_7_10) over () as sumjob_comp_7_10, \n"+
					"sum(t.job_base_11_15) over () as sumjob_base_11_15, sum(t.job_comp_11_15) over () as sumjob_comp_11_15, \n"+
					"sum(t.job_base_15) over () as sumjob_base_15, sum(t.job_comp_15) over () as sumjob_comp_15 \n");
		
		sql.append(" FROM HRM_RecordOfService_V T where AD_Client_ID=" + Env.getAD_Client_ID(Env.getCtx()) + " \n ");
		if (HR_Department_ID != 0)
			sql.append(" AND T.DEPARTMENT_ID=" + HR_Department_ID + " \n ");
		else if(HR_Block_ID !=0)
			sql.append(" AND T.DEPARTMENT_ID IN (SELECT NODE_ID FROM AD_TREENODEDEP WHERE PARENT_ID=" + HR_Block_ID + ") \n");
				
		try
		{
			pstmt = DB.prepareStatement(sql.toString(),null);
			rs = pstmt.executeQuery();	
					
			while (rs.next ())
			{
				values = new RecordOfService();				
				values.setDepartment_id(rs.getInt(3));
				values.setDepartment(rs.getString(4));
				values.setJob_id(rs.getInt(5));
				values.setJob(rs.getString(6));
				values.setDepBase1(rs.getInt(7));
				values.setDepComp1(rs.getInt(8));
				values.setJobBase1(rs.getInt(9));
				values.setJobComp1(rs.getInt(10));
				values.setDepBase1_3(rs.getInt(11));
				values.setDepComp1_3(rs.getInt(12));
				values.setJobBase1_3(rs.getInt(13));
				values.setJobComp1_3(rs.getInt(14));
				values.setDepBase4_6(rs.getInt(15));
				values.setDepComp4_6(rs.getInt(16));
				values.setJobBase4_6(rs.getInt(17));
				values.setJobComp4_6(rs.getInt(18));
				values.setDepBase7_10(rs.getInt(19));
				values.setDepComp7_10(rs.getInt(20));
				values.setJobBase7_10(rs.getInt(21));
				values.setJobComp7_10(rs.getInt(22));
				values.setDepBase11_15(rs.getInt(23));
				values.setDepComp11_15(rs.getInt(24));
				values.setJobBase11_15(rs.getInt(25));
				values.setJobComp11_15(rs.getInt(26));
				values.setDepBase15(rs.getInt(27));
				values.setDepComp15(rs.getInt(28));
				values.setJobBase15(rs.getInt(29));
				values.setJobComp15(rs.getInt(30));
				values.setSumJobBase1(rs.getInt(31));
				values.setSumJobComp1(rs.getInt(32));
				values.setSumJobBase1_3(rs.getInt(33));
				values.setSumJobComp1_3(rs.getInt(34));
				values.setSumJobBase4_6(rs.getInt(35));
				values.setSumJobComp4_6(rs.getInt(36));
				values.setSumJobBase7_10(rs.getInt(37));
				values.setSumJobComp7_10(rs.getInt(38));
				values.setSumJobBase11_15(rs.getInt(39));
				values.setSumJobComp11_15(rs.getInt(40));
				values.setSumJobBase15(rs.getInt(41));
				values.setSumJobComp15(rs.getInt(42));
				
				list.add(values);
			}
		}
		catch (SQLException e)
		{
			log.log(Level.SEVERE, "product", e);
		}
		finally
		{
			DB.close(rs, pstmt);
			rs = null; pstmt = null;
		}	
		
		return list.toArray(new RecordOfService[list.size()]);
	}

}

class RecordOfService{	
	
	private int department_id;
	private String department;
	private int job_id;
	private String job;	
	private int depBase1;
	private int depComp1;
	private int jobBase1;
	private int jobComp1;
	private int depBase1_3;
	private int depComp1_3;
	private int jobBase1_3;
	private int jobComp1_3;
	private int depBase4_6;
	private int depComp4_6;
	private int jobBase4_6;
	private int jobComp4_6;
	private int depBase7_10;
	private int depComp7_10;
	private int jobBase7_10;
	private int jobComp7_10;
	private int depBase11_15;
	private int depComp11_15;
	private int jobBase11_15;
	private int jobComp11_15;
	private int depBase15;
	private int depComp15;
	private int jobBase15;
	private int jobComp15;
	private int sumJobBase1;
	private int sumJobComp1;
	private int sumJobBase1_3;
	private int sumJobComp1_3;
	private int sumJobBase4_6;
	private int sumJobComp4_6;
	private int sumJobBase7_10;
	private int sumJobComp7_10;
	private int sumJobBase11_15;
	private int sumJobComp11_15;
	private int sumJobBase15;
	private int sumJobComp15;	
	
	public int getDepartment_id() {
		return department_id;
	}
	public void setDepartment_id(int department_id) {
		this.department_id = department_id;
	}
	public String getDepartment() {
		return department;
	}
	public void setDepartment(String department) {
		this.department = department;
	}
	public int getJob_id() {
		return job_id;
	}
	public void setJob_id(int job_id) {
		this.job_id = job_id;
	}
	public String getJob() {
		return job;
	}
	public void setJob(String job) {
		this.job = job;
	}	
	public int getDepBase1() {
		return depBase1;
	}
	public void setDepBase1(int depBase1) {
		this.depBase1 = depBase1;
	}
	public int getDepComp1() {
		return depComp1;
	}
	public void setDepComp1(int depComp1) {
		this.depComp1 = depComp1;
	}
	public int getJobBase1() {
		return jobBase1;
	}
	public void setJobBase1(int jobBase1) {
		this.jobBase1 = jobBase1;
	}
	public int getJobComp1() {
		return jobComp1;
	}
	public void setJobComp1(int jobComp1) {
		this.jobComp1 = jobComp1;
	}
	public int getDepBase1_3() {
		return depBase1_3;
	}
	public void setDepBase1_3(int depBase1_3) {
		this.depBase1_3 = depBase1_3;
	}
	public int getDepComp1_3() {
		return depComp1_3;
	}
	public void setDepComp1_3(int depComp1_3) {
		this.depComp1_3 = depComp1_3;
	}
	public int getJobBase1_3() {
		return jobBase1_3;
	}
	public void setJobBase1_3(int jobBase1_3) {
		this.jobBase1_3 = jobBase1_3;
	}
	public int getJobComp1_3() {
		return jobComp1_3;
	}
	public void setJobComp1_3(int jobComp1_3) {
		this.jobComp1_3 = jobComp1_3;
	}
	public int getDepBase4_6() {
		return depBase4_6;
	}
	public void setDepBase4_6(int depBase4_6) {
		this.depBase4_6 = depBase4_6;
	}
	public int getDepComp4_6() {
		return depComp4_6;
	}
	public void setDepComp4_6(int depComp4_6) {
		this.depComp4_6 = depComp4_6;
	}
	public int getJobBase4_6() {
		return jobBase4_6;
	}
	public void setJobBase4_6(int jobBase4_6) {
		this.jobBase4_6 = jobBase4_6;
	}
	public int getJobComp4_6() {
		return jobComp4_6;
	}
	public void setJobComp4_6(int jobComp4_6) {
		this.jobComp4_6 = jobComp4_6;
	}
	public int getDepBase7_10() {
		return depBase7_10;
	}
	public void setDepBase7_10(int depBase7_10) {
		this.depBase7_10 = depBase7_10;
	}
	public int getDepComp7_10() {
		return depComp7_10;
	}
	public void setDepComp7_10(int depComp7_10) {
		this.depComp7_10 = depComp7_10;
	}
	public int getJobBase7_10() {
		return jobBase7_10;
	}
	public void setJobBase7_10(int jobBase7_10) {
		this.jobBase7_10 = jobBase7_10;
	}
	public int getJobComp7_10() {
		return jobComp7_10;
	}
	public void setJobComp7_10(int jobComp7_10) {
		this.jobComp7_10 = jobComp7_10;
	}
	public int getDepBase11_15() {
		return depBase11_15;
	}
	public void setDepBase11_15(int depBase11_15) {
		this.depBase11_15 = depBase11_15;
	}
	public int getDepComp11_15() {
		return depComp11_15;
	}
	public void setDepComp11_15(int depComp11_15) {
		this.depComp11_15 = depComp11_15;
	}
	public int getJobBase11_15() {
		return jobBase11_15;
	}
	public void setJobBase11_15(int jobBase11_15) {
		this.jobBase11_15 = jobBase11_15;
	}
	public int getJobComp11_15() {
		return jobComp11_15;
	}
	public void setJobComp11_15(int jobComp11_15) {
		this.jobComp11_15 = jobComp11_15;
	}
	public int getDepBase15() {
		return depBase15;
	}
	public void setDepBase15(int depBase15) {
		this.depBase15 = depBase15;
	}
	public int getDepComp15() {
		return depComp15;
	}
	public void setDepComp15(int depComp15) {
		this.depComp15 = depComp15;
	}
	public int getJobBase15() {
		return jobBase15;
	}
	public void setJobBase15(int jobBase15) {
		this.jobBase15 = jobBase15;
	}
	public int getJobComp15() {
		return jobComp15;
	}
	public void setJobComp15(int jobComp15) {
		this.jobComp15 = jobComp15;
	}
	public int getSumJobBase1() {
		return sumJobBase1;
	}
	public void setSumJobBase1(int sumJobBase1) {
		this.sumJobBase1 = sumJobBase1;
	}
	public int getSumJobComp1() {
		return sumJobComp1;
	}
	public void setSumJobComp1(int sumJobComp1) {
		this.sumJobComp1 = sumJobComp1;
	}
	public int getSumJobBase1_3() {
		return sumJobBase1_3;
	}
	public void setSumJobBase1_3(int sumJobBase1_3) {
		this.sumJobBase1_3 = sumJobBase1_3;
	}
	public int getSumJobComp1_3() {
		return sumJobComp1_3;
	}
	public void setSumJobComp1_3(int sumJobComp1_3) {
		this.sumJobComp1_3 = sumJobComp1_3;
	}
	public int getSumJobBase4_6() {
		return sumJobBase4_6;
	}
	public void setSumJobBase4_6(int sumJobBase4_6) {
		this.sumJobBase4_6 = sumJobBase4_6;
	}
	public int getSumJobComp4_6() {
		return sumJobComp4_6;
	}
	public void setSumJobComp4_6(int sumJobComp4_6) {
		this.sumJobComp4_6 = sumJobComp4_6;
	}
	public int getSumJobBase7_10() {
		return sumJobBase7_10;
	}
	public void setSumJobBase7_10(int sumJobBase7_10) {
		this.sumJobBase7_10 = sumJobBase7_10;
	}
	public int getSumJobComp7_10() {
		return sumJobComp7_10;
	}
	public void setSumJobComp7_10(int sumJobComp7_10) {
		this.sumJobComp7_10 = sumJobComp7_10;
	}
	public int getSumJobBase11_15() {
		return sumJobBase11_15;
	}
	public void setSumJobBase11_15(int sumJobBase11_15) {
		this.sumJobBase11_15 = sumJobBase11_15;
	}
	public int getSumJobComp11_15() {
		return sumJobComp11_15;
	}
	public void setSumJobComp11_15(int sumJobComp11_15) {
		this.sumJobComp11_15 = sumJobComp11_15;
	}
	public int getSumJobBase15() {
		return sumJobBase15;
	}
	public void setSumJobBase15(int sumJobBase15) {
		this.sumJobBase15 = sumJobBase15;
	}
	public int getSumJobComp15() {
		return sumJobComp15;
	}
	public void setSumJobComp15(int sumJobComp15) {
		this.sumJobComp15 = sumJobComp15;
	}
	
}
